feat: ControlledVectorField and ComposedVectorField (state-space control composition)#475
Merged
Merged
Conversation
…rol composition)
State-space analogues of PseudoHamiltonian / ComposedHamiltonian, for the
OpenLoop / ClosedLoop control-flow path.
- `Data.ControlledVectorField{F,TD,VD} <: AbstractControlledVectorField{TD,VD}` — a
controlled vector field `fc(t,x,u,v)` with an explicit control argument, out-of-place
(no mutability trait), `dynamics_trait = StateDynamics`. Natural + uniform (t,x,u,v)
call signatures.
- `Data.ComposedVectorField{TD,VD,CVF,L} <: AbstractVectorField{TD,VD,OutOfPlace}` —
functor `g(t,x,v) = fc(t,x,u(...),v)` composing a controlled vector field with an
OpenLoop or ClosedLoop control law. The control is read via the law's feedback-
dispatched uniform call (open-loop `u(t,v)`, closed-loop `u(t,x,v)`); composed traits
are the join of the two inputs, so fc and law may carry different TD/VD. Rejects
DynClosedLoop (that is the Hamiltonian path). Getters `controlled_vector_field`,
`control_law`.
Reuses `_join_td` / `_join_vd` from the composed-Hamiltonian module. Tests cover all
call arities, cross-trait joins, contract (AbstractVectorField / OutOfPlace /
StateDynamics), type stability, and the DynClosedLoop rejection. Full suite: 4315/4315.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the state-space analogues of
PseudoHamiltonian/ComposedHamiltonian, for the OpenLoop / ClosedLoop control-flow path (CTFlows Phase A′).Data.ControlledVectorField{F,TD,VD} <: AbstractControlledVectorField{TD,VD}— a controlled vector fieldfc(t,x,u,v)with an explicit control argument, out-of-place (no mutability trait),dynamics_trait = StateDynamics. Natural + uniform(t,x,u,v)call signatures.Data.ComposedVectorField{TD,VD,CVF,L} <: AbstractVectorField{TD,VD,OutOfPlace}— functorg(t,x,v) = fc(t,x,u(...),v)composing a controlled vector field with an OpenLoop or ClosedLoop control law. The control is read via the law's feedback-dispatched uniform call (open-loopu(t,v), closed-loopu(t,x,v)).Notes
fcand the law may carry differentTD/VD— the composition always goes through the uniform calls, so individual traits need not match. Tested for cross-trait cases (autonomous fc + non-autonomous law → NonAutonomous; fixed fc + variable law → NonFixed).DynClosedLooplaws (that is the Hamiltonian path —ComposedHamiltonian)._join_td/_join_vdfrom the composed-Hamiltonian module.controlled_vector_field,control_law.Tests
test/suite/data/test_controlled_vector_field.jlandtest_composed_vector_field.jl: all call arities, cross-trait joins, contract (AbstractVectorField/OutOfPlace/StateDynamics), type stability (@inferred), and theDynClosedLooprejection. Full suite green: 4315/4315.Downstream
CTFlows Phase A′ will use these to wire
Flow(fc, law)andFlow(ocp, OpenLoop/ClosedLoop)→ a state flow returning aControlledTrajectory(state + reconstructed control, no costate). Requires a new CTBase beta.🤖 Generated with Claude Code